﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace TKT.Lifter.CIM.Lifter.TibcoMsg.Lifter
{
    public class CarrierIDReadEventReport : MessageBody
    {
        public string MachineName { get; set; }
        public string UnitID { get; set; }
        public string CarrierID { get; set; }
        public string CarrierLocation { get; set; }
        public string IDReadStatus { get; set; }

        public CarrierIDReadEventReport()
            : base("CarrierIDRead")
        { }

        public override System.Xml.Linq.XElement ToXElement()
        {
            XElement body = new XElement("Body");
            body.Add(new XElement("MACHINENAME", this.MachineName));
            body.Add(new XElement("UNITID", this.UnitID));
            body.Add(new XElement("CARRIERID", this.CarrierID));
            body.Add(new XElement("CARRIERLOC", this.CarrierLocation));
            body.Add(new XElement("IDREADSTATUS", this.IDReadStatus));
            return body;
        }

        public override void Parse(System.Xml.Linq.XElement body)
        {
            this.MachineName = body.Element("MACHINENAME").Value;
            this.UnitID = body.Element("UNITID").Value;
            this.CarrierID = body.Element("CARRIERID").Value;
            this.CarrierLocation = body.Element("CARRIERLOC").Value;
            this.IDReadStatus = body.Element("IDREADSTATUS").Value;
        }
    }
}
